package com.matt.foundation.constant;

import lombok.Setter;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/9/29
 * *******************************
 */
public class ContractConstant {


    public enum Status{
        NON_START(2, "未开始"),
        ACTIVE(0, "进行中"),
        TRANSFERRED(3, "已转班"),
        END(1, "已结束");

        @Setter
        private int code;

        @Setter
        private String value;

        Status(int code, String value){
            this.code = code;
            this.value = value;
        }

        public int codeOf(){
            return code;
        }

        public String valueOf(){
            return value;
        }

        public Status get(int code){
            for (Status status : values()) {
                if (status.codeOf()==code)
                    return status;
            }
            return null;
        }
    }

    public enum Category{
        NURSERY(1, "托班"),
        EARLY(2, "早教"),
        OTHER(3, "其他"),
        CAMERA(4, "摄像头"),
        DEPOSIT(5, "定金/储值");
//3：其它  4：摄像头  5：订金
        @Setter
        private int code;

        @Setter
        private String value;

        Category(int code, String value){
            this.code = code;
            this.value = value;
        }

        public int codeOf(){
            return code;
        }

        public String valueOf(){
            return value;
        }

        public Category get(int code){
            for (Category category : values()) {
                if (category.codeOf()==code)
                    return category;
            }
            return null;
        }
    }
}
